﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RevClinic.Core.Domain
{
    public class Address : ValueObject<Address>
    {
        private readonly string _streetName;
        private readonly string _homeNumber;
        private readonly string _postalCode;
        private readonly string _city;
        private readonly string _municipality;
        private readonly string _telephone;

        public Address() { }

        public Address(
            string streetName,
            string homeNumber,
            string postalCode,
            string city,
            string municipality,
            string telephone)
        {
            _streetName = streetName;
            _homeNumber = homeNumber;
            _postalCode = postalCode;
            _city = city;
            _municipality = municipality;
            _telephone = telephone;
        }

        public string StreetName { get { return _streetName; } }

        public string HomeNumber { get { return _homeNumber; } }

        public string PostalCode { get { return _postalCode; } }

        public string City { get { return _city; } }

        public string Municipality { get { return _municipality; } }

        public string Telephone { get { return _telephone; } }


        protected override IEnumerable<object> GetAtomicValues()
        {
            yield return _streetName;
            yield return _homeNumber;
            yield return _postalCode;
            yield return _city;
            yield return _municipality;
            yield return _telephone;
        }
    }
}
